Tags: style blog http io os ar java for SPJava Operation MySQL Database code we have a very familiar, and additions and deletions, Java to the MongoDB database is similar to the operation, first database connection, and then the operation.First we enter into the admin database, and then set up their own database Testmongodb, access to the admin database, you can
In the previous article, we talked about MongoDB's command to get started, this blog will be based on the previous blog created database and table completed a simple Java MongoDB CRUD Example, using Java to connect MongoDB database. and implement routines such as creating a
In the previous article we talked about MongoDB's command to get started, this blog will be based on the database and table established in the previous blog to complete a simple Java MongoDB CRUD Example, the use of Java to connect MongoDB database, and the implementation of
:561baace3aea5b925fddc83cTitle: A good successor to socialismContent: Good study, Day day upFansunionDate: Mon Oct 2015 20:42:54 CSTId:1-----------------------Built-in id:561baace3aea5b925fddc83dTitle: A good capitalist grave diggerContent: Work hard, always upFansunionDate: Mon Oct 2015 20:42:54 CSTId:2-----------------------Change the author of the article titled HelloWorld to Ray and modify only AUTHOR1 fieldsBuilt-in id:561baace3aea5b925fddc83cTitle: A good successor to socialismContent: Goo
1 ImportJava.util.HashMap;2 ImportJava.util.Map;3 ImportJava.util.Map.Entry;4 //in a positive integer less than 99999, find the number that meets the following criteria, which is both a full square number,5 //another two digits are the same, such as: 144,676. 6 Public classWQS {7 8 //Total Square Number9 Public Static BooleanIswqs (intN) {Ten inti; One Doubledn=math.sqrt (n); A if(Dn-(int) dn==0) - ret
Previous article: Http://www.cnblogs.com/hoojo/archive/2011/06/01/2066426.html introduced to the MONGODB console to complete the data manipulation of MongoDB, We have a comprehensive understanding and understanding of MongoDB through the previous article. Now we're going to use Java to manipulate
.
MongoDBfor Java API documentation address: http://api.mongodb.org/java/2.6.5/
MongoDB for Java related operation instance code: http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-java-driver/
I created a Maven project. The pom file is as follows:
If
This article mainly introduces Java operation MongoDB.
Development environment:
System:windows
Ide:eclipse, MyEclipse 8
Database:mongodb
To develop a dependent library:
JavaEE5, Mongo-2.5.3.jar, Junit-4.8.2.jar
First, preparatory work
1, first of all, download the MongoDB Java-supported driver package
Driver p
the previous large list of errors or people looking uncomfortable, we want to destroy them.Error:cannot Find module '. /build/release/bson ' Solution{[Error:cannot find module '. /build/release/bson '] Code: ' Module_not_found ' }js-bson:failed to load C + + Bson extension, using pure JS versionThe first two lines say that no Bson module was found. Okay, we'll install it right away:NPM Install BsonThen the
API document address is: HTTP://API.MONGODB.ORG/JAVA/2.6.5/
MongoDB for Java related Operation instance code: http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-java-driver/
I'm creating a MAVEN project with the following POM files:
If your development environment does not have a MAVEN envi
and nosql
As a nosql solution, MongoDB is easy to use. During my first in-depth research on nosql databases, I tried a lot of Java-based solutions and found out what column family is) what is the relationship between hadoop and hbase, and what is zookeeper very time-consuming. When I finally want to understand these problems, I realized that Cassandra, hbase, and other products are all very well-developed
MongoDB official Java driver, save and read, the need is DBObject object, this is an interface, implement Put,get and other methods, similar to map, if we want to directly save ordinary Java objects to MongoDB, You need to convert to dbobject objects, or directly implement the DBObject interface, which is very complex
Original address: http://blog.csdn.net/drifterj/article/details/7948090Directory Address: HTTP://BLOG.CSDN.NET/DRIFTERJ/ARTICLE/CATEGORY/1191327/2In the front we all manipulate the data accessing MongoDB through the shell, the language used in the shell is JavaScript. Let's talk about how to access the MongoDB database through Java.The Java driver is the earliest
communication with the database.Dbcollection coll = db.getcollection ("Collection1");To get a "show tables" feature like MySQL, you can use the following code:SetMongoDB stores the JSON-formatted document, and the simplest class in Java that represents this data format is map. The basicdbobject provided in MongoDB Java driver is a map (which inherits from the Li
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.